package seed_partner_admin

import (
	"fmt"
	"gitee.com/theegg/go-brick/app/model/partner/partner_admin/partner_admin_role_menus"
	"gitee.com/theegg/go-brick/app/service/app"
)

func InitPartnerAdminRoleMenusSeed() {
	count := 0
	errCount := 0
	for _, item := range PartnerAdminMenusSeedData {
		// 超级管理员角色　分配角色ID
		item := partner_admin_role_menus.PartnerAdminRoleMenus{
			RoleId: 1,
			MenuId: item.Id,
		}

		_, err := app.Db().Insert(item)
		if err != nil {
			fmt.Println(err.Error())
			errCount++
		} else {
			count++
		}
	}

	fmt.Printf("%5s|%25s|%10d|%8d|\n", "", "partner_admin_role_menus", count, errCount)
}
